laravel validation time hours minutes format

49

laravel validation time hours minutes format -

public function store(Illuminate\Http\Request $request)
{
    $this->validate($request, [
        'time_start' => 'date_format:H:i',
        'time_end' => 'date_format:H:i|after:time_start',
    ]);

    // do other stuff
}

in laravel date duration validation rule -

[
  'from' =>  ['required', 'date_format:Y-m-d', 'before_or_equal:to'],
  'to'  => ['required', 'date_format:Y-m-d']
]
//@sujay

Comments

Submit
0 Comments